package BLC

import (
	"bytes"
	"encoding/json"
	"log"
	"encoding/binary"
)

func IntToHex(num int64)[]byte{
	buff:=new(bytes.Buffer)//设计一个缓冲区
	//将大整数转化为字节数组
	err:=binary.Write(buff,binary.BigEndian,num)
	if err!=nil{
		log.Panic(err)
	}
	return buff.Bytes()
}

// 标准的JSON字符串转数组
func JSONToArray(jsonString string) []string {

	//json 到 []string
	var sArr []string
	print(jsonString)
	if err := json.Unmarshal([]byte(jsonString), &sArr); err != nil {
		log.Panic(err)
	}
	return sArr
}